package a.d;

import a.c.v;
import a.c.y;
import a.c.z;
import a.i.l;
import a.i.mb;

import java.util.Comparator;

public class m
{
  static final int a = 15;
  public static boolean b;
  
  public static void a(z paramz, g_ paramg_)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    d_[] arrayOfd_ = c(paramz);
    mb localmb = new mb();
    double d1 = 1.7976931348623157E+308D;
    double d2 = -1.797693134862316E+308D;
    Object localObject1 = paramz.f();
    if (localObject1 != null) {}
    while (bool2)
    {
      localObject2 = ((p)((v)localObject1).c()).a();
      double d3 = ((t)localObject2).b;
      if (!bool2)
      {
        if (d3 >= 0.0D)
        {
          d1 = Math.min(d1, ((t)localObject2).e);
          d2 = Math.max(d2, ((t)localObject2).e + d3);
        }
        localObject1 = ((v)localObject1).a();
      }
      if (!bool1) {
        break;
      }
    }
    localObject1 = new e_(d1, d2, 15);
    Object localObject2 = new mb();
    int i = 0;
    do
    {
      if (i >= arrayOfd_.length) {
        break;
      }
      d_ locald_ = arrayOfd_[i];
      if (!bool2)
      {
        switch (locald_.d)
        {
        case 0: 
          ((c_)localObject1).a(locald_.e, paramg_);
          ((c_)localObject1).a(locald_.e);
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break;
          }
        case 1: 
          ((c_)localObject1).c(locald_.e);
        }
        i++;
      }
    } while (!bool1);
  }
  
  protected static z a(z paramz)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    z localz = new z();
    y localy = paramz.h();
    if (localy.e()) {}
    while (bool2)
    {
      p localp = (p)localy.j();
      t localt = localp.a();
      double d1 = localt.b;
      double d2 = localt.a;
      if ((!bool2) && (bool1)) {
        return localz;
      }
      if (!bool2)
      {
        if ((d1 >= 0.0D) && (d2 >= 0.0D))
        {
          a_ locala_ = new a_(localt.e, localt.e + d1, localp);
          d_ locald_1 = new d_(localt.d, 0, locala_);
          d_ locald_2 = new d_(localt.d + d2, 1, locala_);
          localz.add(locald_1);
          localz.add(locald_2);
        }
        localy.f();
      }
      if (!bool1) {
        break;
      }
    }
    localz.a(new b_());
    return localz;
  }
  
  static d_[] c(z paramz)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    z localz = new z();
    Object localObject = paramz.h();
    if (((y)localObject).e()) {}
    while (bool2)
    {
      p localp = (p)((y)localObject).j();
      t localt = localp.a();
      double d1 = localt.b;
      double d2 = localt.a;
      if (bool1) {
        break label180;
      }
      if ((d1 >= 0.0D) && (d2 >= 0.0D))
      {
        a_ locala_ = new a_(localt.e, localt.e + d1, localp);
        d_ locald_1 = new d_(localt.d, 0, locala_);
        d_ locald_2 = new d_(localt.d + d2, 1, locala_);
        localz.add(locald_1);
        localz.add(locald_2);
      }
      ((y)localObject).f();
      if (!bool1) {
        break;
      }
    }
    label180:
    localObject = new d_[localz.size()];
    localz.toArray((Object[])localObject);
    l.a((Object[])localObject, new b_());
    return localObject;
  }
  
  static class e_
    implements m.c_
  {
    z[] a;
    v b;
    final double c;
    final double d;
    final double e;
    final int f;
    
    e_(double paramDouble1, double paramDouble2, int paramInt)
    {
      this.a = new z[paramInt];
      int i = 0;
      if (i < this.a.length) {}
      do
      {
        this.a[i] = new z();
        i++;
        if ((!bool2) && (bool1)) {
          return;
        }
        if (!bool1) {
          break;
        }
        this.c = paramDouble1;
        this.d = paramDouble2;
        this.e = (paramDouble2 - paramDouble1 + 1.0D);
      } while (bool2);
      this.f = (this.a.length / 2);
    }
    
    public void a(m.a_ parama_)
    {
      boolean bool2 = w.e;
      boolean bool1 = w.d;
      int i = 0;
      double d1 = this.c;
      double d2 = this.d;
      label88:
      do
      {
        double d3;
        do
        {
          if (i >= this.f) {
            break label110;
          }
          d3 = 0.5D * (d2 - d1);
          if (bool1) {
            break label180;
          }
          if (bool2) {
            break label88;
          }
          if (parama_.b >= d3) {
            break;
          }
          i = (i << 1) + 1;
          d2 = d3;
        } while ((!bool2) && (!bool1));
        if (!bool2)
        {
          if (parama_.a <= d3) {
            break;
          }
          i = (i << 1) + 2;
          d1 = d3;
        }
      } while (!bool1);
      label110:
      if (!bool2) {
        if ((bool2) || (this.b != null))
        {
          v localv = (v)this.b.c();
          this.b.a(parama_);
          this.a[i].a(this.b);
          parama_.e = this.b;
          this.b = localv;
          if (!bool1) {}
        }
        else
        {
          parama_.e = this.a[i].b(parama_);
        }
      }
      label180:
    }
    
    public void c(m.a_ parama_)
    {
      boolean bool2 = w.e;
      boolean bool1 = w.d;
      int i = 0;
      double d1 = this.c;
      double d2 = this.d;
      label98:
      do
      {
        double d3;
        do
        {
          if (i >= this.f) {
            break label115;
          }
          d3 = 0.5D * (d2 - d1);
          if (bool2) {
            return;
          }
          if (bool1) {
            break label135;
          }
          if (bool2) {
            break label98;
          }
          if (parama_.b >= d3) {
            break;
          }
          i = (i << 1) + 1;
          d2 = d3;
          if (bool2) {
            break label98;
          }
        } while (!bool1);
        if (bool2) {
          break label128;
        }
        if (parama_.a <= d3) {
          break;
        }
        i = (i << 1) + 2;
        d1 = d3;
      } while (!bool1);
      label115:
      this.a[i].h(parama_.e);
      label128:
      if (!bool2)
      {
        label135:
        parama_.e.a(this.b);
        this.b = parama_.e;
      }
    }
    
    void a(m.a_ parama_, m.g_ paramg_, int paramInt, double paramDouble1, double paramDouble2)
    {
      boolean bool2 = w.e;
      boolean bool1 = w.d;
      double d1 = 0.5D * (paramDouble2 - paramDouble1);
      Object localObject = parama_.d;
      v localv;
      m.a_ locala_;
      if ((bool2) || (paramInt < this.f))
      {
        if (!bool2) {
          if (parama_.b < d1)
          {
            localv = this.a[paramInt].f();
            do
            {
              if (localv == null) {
                break;
              }
              locala_ = (m.a_)localv.c();
              if (bool2) {
                break label174;
              }
              if (bool1) {
                break label172;
              }
              if (!bool2)
              {
                if (locala_.b >= parama_.a)
                {
                  if (bool2) {
                    continue;
                  }
                  if (locala_.a <= parama_.b) {
                    paramg_.a(localObject, locala_.d);
                  }
                }
                localv = localv.a();
              }
            } while (!bool1);
            if (bool2) {
              break label407;
            }
            a(parama_, paramg_, (paramInt << 1) + 1, paramDouble1, d1);
            label172:
            label174:
            if ((!bool2) && (!bool1)) {
              return;
            }
          }
        }
        if (parama_.a > d1)
        {
          localv = this.a[paramInt].f();
          do
          {
            if (localv == null) {
              break;
            }
            locala_ = (m.a_)localv.c();
            if (bool2) {
              break label311;
            }
            if (bool1) {
              break label309;
            }
            if (!bool2)
            {
              if (locala_.b >= parama_.a)
              {
                if (bool2) {
                  continue;
                }
                if (locala_.a <= parama_.b) {
                  paramg_.a(localObject, locala_.d);
                }
              }
              localv = localv.a();
            }
          } while (!bool1);
          if (!bool2)
          {
            a(parama_, paramg_, (paramInt << 1) + 2, d1, paramDouble2);
            label309:
            if (!bool1) {
              label311:
              return;
            }
          }
        }
        else
        {
          localv = this.a[paramInt].f();
          if (localv != null) {}
          do
          {
            locala_ = (m.a_)localv.c();
            paramg_.a(localObject, locala_.d);
            localv = localv.a();
            if (bool2) {
              break label412;
            }
            if (bool1) {
              break label410;
            }
            if (!bool1) {
              break;
            }
            a(parama_, paramg_, (paramInt << 1) + 1, paramDouble1, d1);
          } while (bool2);
        }
        label407:
        a(parama_, paramg_, (paramInt << 1) + 2, d1, paramDouble2);
        label410:
        label412:
        if (!bool1) {}
      }
      else
      {
        localv = this.a[paramInt].f();
        do
        {
          if (localv == null) {
            break;
          }
          locala_ = (m.a_)localv.c();
          if (!bool2)
          {
            if (locala_.b >= parama_.a)
            {
              if (bool2) {
                continue;
              }
              if (locala_.a <= parama_.b) {
                paramg_.a(localObject, locala_.d);
              }
            }
            localv = localv.a();
          }
        } while (!bool1);
      }
    }
    
    public void a(m.a_ parama_, m.g_ paramg_)
    {
      a(parama_, paramg_, 0, this.c, this.d);
    }
  }
  
  static abstract interface c_
  {
    public abstract void a(m.a_ parama_);
    
    public abstract void c(m.a_ parama_);
    
    public abstract void a(m.a_ parama_, m.g_ paramg_);
  }
  
  static class a_
  {
    final double a;
    final double b;
    final int c;
    Object d;
    v e;
    
    public a_(double paramDouble1, double paramDouble2, Object paramObject)
    {
      this.a = paramDouble1;
      this.b = paramDouble2;
      this.c = 0;
      this.d = paramObject;
    }
    
    public a_(double paramDouble1, double paramDouble2, Object paramObject, int paramInt)
    {
      this.a = paramDouble1;
      this.b = paramDouble2;
      this.c = paramInt;
      this.d = paramObject;
    }
  }
  
  static class b_
    implements Comparator
  {
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = w.e;
      m.d_ locald_1 = (m.d_)paramObject1;
      m.d_ locald_2 = (m.d_)paramObject2;
      if (!bool) {
        if (locald_1.b < locald_2.b) {
          return -1;
        }
      }
      if (!bool) {
        if (locald_1.b > locald_2.b) {
          return 1;
        }
      }
      if (!bool) {
        if (locald_1.d == 1)
        {
          if (bool) {
            break label88;
          }
          if (locald_2.d == 0) {
            return 1;
          }
        }
      }
      label88:
      if (!bool) {
        if (locald_1.d == 0)
        {
          if (bool) {
            break label113;
          }
          if (locald_2.d == 1) {
            return -1;
          }
        }
      }
      label113:
      return 0;
    }
    
    public boolean equals(Object paramObject)
    {
      return false;
    }
  }
  
  static class d_
    implements m.f_
  {
    final double b;
    final int d;
    final m.a_ e;
    
    public d_(double paramDouble, int paramInt, m.a_ parama_)
    {
      this.e = parama_;
      this.b = paramDouble;
      this.d = paramInt;
    }
    
    public double a()
    {
      return this.b;
    }
    
    public int c()
    {
      return this.d;
    }
    
    public m.a_ d()
    {
      return this.e;
    }
  }
  
  static abstract interface f_
  {
    public static final int a = 0;
    public static final int c = 1;
  }
  
  public static abstract interface g_
  {
    public abstract void a(Object paramObject1, Object paramObject2);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.d.m

 * JD-Core Version:    0.7.0.1

 */